package com.twu.biblioteca;

import java.io.PrintStream;
import java.util.Scanner;

public class ConsoleInterface {

    public static final String PROMPT_FOR_ACTION = "Please choose an action:";
    public static final String VIEW_A_LIST_OF_ALL_THE_BOOKS_IN_THE_LIBRARY = "1) View a list of all the books in the library.";
    public static final String RESERVE_A_BOOK_FOR_COLLECTION = "2) Reserve a book for collection.";
    public static final String CHECK_YOUR_MEMBERSHIP_DETAILS = "3) Check your membership details.";

    public static String WELCOME_MESSAGE = "Welcome to Biblioteca.";

    private final PrintStream out;
    private final Scanner inStream;

    public ConsoleInterface(PrintStream printStream, Scanner inStream) {
        this.out = printStream;
        this.inStream = inStream;
    }

    public void welcome() {
        out.println(WELCOME_MESSAGE);
    }

    public void listOptions() {
        //TODO: Turn the strings into an ENUM
        out.println(PROMPT_FOR_ACTION);
        out.println(VIEW_A_LIST_OF_ALL_THE_BOOKS_IN_THE_LIBRARY);
        out.println(RESERVE_A_BOOK_FOR_COLLECTION);
        out.println(CHECK_YOUR_MEMBERSHIP_DETAILS);
    }

    public String getUserInput() {
        return inStream.nextLine();
    }
}
